<template>
    <div class="header-box">
        <h3>八维找房后台管理系统</h3>
        <div>
            {{userInfo.name}}管理员|
            <el-button @click='outLogin'>退出</el-button>
        </div>
    </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
    data(){
        return{
            
        }
    },
    computed:{
        ...mapState(['userInfo'])
    },
    methods:{
        outLogin(){
            localStorage.removeItem('token');
            this.$router.push('/login')
        }
    }
}
</script>

<style lang="scss" scoped>
    .header-box{
        width: 100%;
        height: 80px;
        background: darkslategrey;
        display: flex;
        align-items: center;
        color: #fff;
        justify-content: space-between;
        padding: 0 25px;
        flex-shrink: 0;
    }
</style>